<template>
	<div style="display: flex;flex-direction: column;" class="otherPage corporateOverview companyProfile">
		<Header :selected="3"></Header>

		<div class="bannerArea">
			<div class="banner" :style="bgImg? 'background:url('+bgImg+') no-repeat;background-size:cover;':''">
			</div>
		</div>
		<Navigation v-loading="loading" :items="breadcrumbItems" :menus="menus" :checked="1" :bgColor="bgColor">
		</Navigation>
		<div class="content" style="min-height: 600px;">
			<div class="content_bg" style="min-height: 600px;">
				<el-row>
					<el-col :span="1">&nbsp; </el-col>
					<el-col :span="22">
						<div v-html="companyProfile.content"></div>
					</el-col>
					<el-col :span="1"> &nbsp;</el-col>
				</el-row>
			</div>

		</div>
		<Footer></Footer>
	</div>
</template>

<script>
	import Header from '../../components/common/header/Header.vue'
	import Navigation from '../../components/common/navigation/Navigation.vue'
	import Footer from '../../components/common/footer/Footer.vue'
	import {
		corporateOverviewMenu
	} from '../../utils/menu.js'
	// 导入您需要的模块
	import Swiper from "swiper";
	export default {
		components: {
			Header,
			Navigation,
			Footer
		},
		data() {
			return {
				loading: true,
				bgImg: '', //头部banner，默认值已绑定，有背景自动切换
				bgColor: "white", //white/red
				menus: corporateOverviewMenu,
				breadcrumbItems: [{
						label: this.$t('home'),
						to: '/'
					},
					{
						label: this.$t('corporateOverview'),
						to: '/corporateOverview'
					},
					{
						label: this.$t('companyProfile'),
						to: '/companyProfile'
					}
				],
				hoverIndex: -1,
				companyProfile: {
					content: ""
				}

			};
		},
		computed: {},
		created() {},
		mounted() {
			this.bindBg();
			this.bindContent().then(i => {
				//this.$request.setImageMaxwidth('img') 
				const images = document.querySelectorAll('img');
				images.forEach(image => {
					image.style.maxWidth = '100%';
					image.style.height = "auto";
					image.parentNode.style.textAlign="center"
				});

			});
		},
		methods: {


			/**
			 * (1)	获取企业简介顶部背景
			 */
			bindBg() {
				let params = {};
				let that = this;
				that.$request.getEnterpriseIntroTopImage(params).then(res => {
					this.bgImg = this.$request.getImgUrl() + res.data.fileUrl
				}).catch((error) => {
					console.log(error);
				});

			},
			/**
			 * (1)	获取企业简介
			 */
			bindContent() {

				return new Promise((resolve, reject) => {
					let params = {};
					let that = this;
					that.$request.getEnterpriseIntro(params).then(res => {
						this.companyProfile.content = res.data.content
						this.loading = false;
						resolve();
					}).catch((error) => {
						console.log(error);
					});
				});
			},
			formatDate(date, format) {
				// 自定义日期格式化方法
				// 可以使用moment.js或其他日期处理库来进行格式化
			},
			gotoNewList() {
				this.$router.push({
					name: "党建新闻列表"
				});
			}

		}
	}
</script>

<style scoped>
	@import url("../../components/common/css/corporateOverview/companyProfile.css");

	.companyProfile img {
		max-width: 100% !important;
	}

	.content_bg {
		margin: 0px auto;
		padding: 50px;

	}

	@media (min-width: 2560px) {
		.content_bg {
			width: calc(2560px * 0.8);
		}
	}

	@media (max-width: 2560px) {
		.content_bg {
			width: calc(2560px * 0.8);
		}
	}

	@media (max-width: 2320px) {
		.content_bg {
			width: calc(2560px * 0.8);
		}
	}

	@media (max-width: 2120px) {
		.content_bg {
			width: calc(2120px * 0.8);
		}
	}

	@media (max-width: 1920px) {
		.content_bg {
			width: calc(1920px * 0.8);
		}

	}

	@media (max-width: 1720px) {


		.content_bg {
			width: calc(1720px * 0.8);
		}
	}

	@media (max-width: 1520px) {
		.content_bg {
			width: calc(1520px * 0.8);
		}
	}

	@media (max-width: 1366px) {
		.content_bg {
			width: calc(1366px * 0.8);
		}
	}

	@media (max-width: 1120px) {
		.content_bg {
			width: 100%
		}
	}

	@media (max-width: 1024px) {}

	@media (max-width: 900px) {}
</style>
